import { View } from "../../../mvc/core/View";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../resource/ImagesConst";
import { ObjCreate } from "../common/ObjCreate";
import { GTextFormat } from "../../../common/GTextFormat";
import { SSystemGetTaskIssue } from "../../../../Message/Game/SSystemGetTaskIssue";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { DataEvent } from "../../events/DataEvent";
import { EffectManager } from "../../manager/EffectManager";
import { UiHintIconView } from "../uiIconBtn/UiHintIconView";
import { GLabel } from "../../../../com/mui/controls/GLabel";
type int = number;
//class KillEvilTaskHintIcon
    
    export  class KillEvilTaskHintIcon extends View
    {
        constructor()
        {
            super();
            this._infos = [];
            this.addChild(GlobalClass.getBitmap(ImagesConst.KillEvil_HintIcon_zhu));
            this.buttonMode = true;
            this._numLabel = ObjCreate.createLabel("", 0, 10, 26, 20, flash.text.TextFormatAlign.RIGHT, this, true, 16777215);
            this._numLabel.setStyle("textFormat", new GTextFormat(null, 10, 16777215, null, null, null, null, null, flash.text.TextFormatAlign.RIGHT));
            return;
        }

        public addInfo(arg1: SSystemGetTaskIssue): void
        {
            var loc1=null;
            var loc2=0;
            this._infos.push(arg1);
            var loc3=0;
            var loc4=this._infos;
            for(loc1 of loc4) 
            {
                loc2 = loc2 + loc1.issueNum;
            }
            this._numLabel.htmlText = loc2 + "";
            return;
        }

        /* internal  */onClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(KillEvilTaskHintIcon.KillEvilHintIconClick, this._infos));
            this._infos = new Array<any>();
            this.hide();
            return;
        }

        public /* override */ show(arg1: int=0, arg2: int=0): void
        {
            this.addEventListener(flash.events.MouseEvent.CLICK, this.onClickHandler);
            EffectManager.glowFilterReg(this, null);
            UiHintIconView.instance.addHintIcon(this);
            return;
        }

        public /* override */ hide(): void
        {
            EffectManager.glowFilterUnReg(this);
            UiHintIconView.instance.removeHintIcon(this);
            this.removeEventListener(flash.events.MouseEvent.CLICK, this.onClickHandler);
            return;
        }

        public static /* const */KillEvilHintIconClick: string="诛邪令_点击诛邪令图标";

        /* internal */ /* var */_numLabel: GLabel;

        /* internal */ /* var */_infos: Array<any>;
    }
